home *** CD-ROM | disk | FTP | other *** search
- #include <QuickDraw.h>
-
- #include "utils.h"
-
-
-
-
- void LocalToGlobalRect(Rect * r)
- {
- LocalToGlobal(TopLeft(r));
- LocalToGlobal(BottomRight(r));
- }
-
- void WindowGlobalPortRect(WindowPtr w, Rect * globalRect)
- {
- Rect r;
- GrafPtr tempPort;
-
- /*******/
-
- r = w->portRect;
-
- GetPort(&tempPort);
- SetPort(w);
- LocalToGlobalRect(&r);
- SetPort(tempPort);
-
- *globalRect = r;
- }
-
- GDHandle WindowMaxGDev(WindowPtr w)
- {
- Rect r;
-
- /*********/
-
- WindowGlobalPortRect(w, &r);
-
- return GetMaxDevice(&r);
-
- }
-
- float SingleRandom(float limit)
- { unsigned long x;
-
- x = (unsigned short)Random() + ((unsigned short)Random() << 16);
-
- return (float)x / 4294967296.0 * limit;
- }